<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<meta http-equiv="X-UA-Compatible" content="IE=edge">
		<title>广东国防教育学会</title>
		<meta name="viewport" content="initial-scale=1, maximum-scale=1">
		<meta name="apple-mobile-web-app-capable" content="yes">
		<meta name="apple-mobile-web-app-status-bar-style" content="black">
		<link rel="stylesheet" href="http://g.alicdn.com/msui/sm/0.6.2/css/sm.min.css" />
		<link rel="stylesheet" href="http://idangero.us/swiper/dist/css/swiper.min.css" />
		<link rel="stylesheet" href="/Public/Home/activity/css/style.css" />
	</head>
	<body>

<header class="bar bar-nav">
	<h1 class='title'>用户信息</h1>
</header>
<style>
.item-input select{font-size:14px;}
</style>
<div class="bar bar-nav">
	<h1 class="title">答题用户信息</h1>
	<i class="icon icon-left" onclick="window.location.href='<?php echo U('Answer/answer_index');?>'"></i>
</div>
<div class="content">
	<form id="answer_form" name="answer_true_form" method="post" onsubmit="return false">
	<div class="list-block" style="margin-top: 1px;">
		<ul>
			<!-- Text inputs -->
			<li>
				<div class="item-content">
					<div class="item-media"><i class="icon icon-form-name"></i></div>
					<div class="item-inner">
						<div class="item-title label">地区</div>
						<div class="item-input row">
							<!--<input type="text" placeholder="请填写地区，如：天河区">-->
							<div class="col-33">
								<select name="province" class="form-control">
								</select>
							</div>
							<div class="col-33">
								<select name="city" class="form-control">
								</select>
							</div>
							<div class="col-33">
								<select name="area" class="form-control">
								</select>
							</div>
						</div>
					</div>
				</div>
			</li>
			<li>
				<div class="item-content">
					<div class="item-media"><i class="icon icon-form-email"></i></div>
					<div class="item-inner">
						<div class="item-title label">学校</div>
						<div class="item-input">
							<input name="school" type="text" placeholder="请填写正确的学校全称">
						</div>
					</div>
				</div>
			</li>
			<!--<li>
				<div class="item-content">
					<div class="item-media"><i class="icon icon-form-gender"></i></div>
					<div class="item-inner">
						<div class="item-title label">性别</div>
						<div class="item-input">
							<select>
								<option>Male</option>
								<option>Female</option>
							</select>
						</div>
					</div>
				</div>
			</li>-->
			<!-- Date -->
			<!--<li>
				<div class="item-content">
					<div class="item-media"><i class="icon icon-form-calendar"></i></div>
					<div class="item-inner">
						<div class="item-title label">生日</div>
						<div class="item-input">
							<input type="date" placeholder="Birth day" value="2014-04-30">
						</div>
					</div>
				</div>
			</li>-->
			<!-- Switch (Checkbox) -->

			<!--<li class="align-top">
				<div class="item-content">
					<div class="item-media"><i class="icon icon-form-comment"></i></div>
					<div class="item-inner">
						<div class="item-title label">文本域</div>
						<div class="item-input">
							<textarea></textarea>
						</div>
					</div>
				</div>
			</li>-->
		</ul>
	</div>
	<div class="content-block">
		<div class="row">
			<div class="col-50"><a href="#" class="button button-big button-fill button-danger">取消</a></div>
			<div class="col-50"><a id="sumbitBtn" class="button button-big button-fill button-success">提交</a></div>
		</div>
	</div>
	</form>
</div>
</body>
</html>
<script type="text/javascript" src="/Public/Home/activity/js/jquery-2.1.0.js" ></script>
<script src="/Public/Home/js/region_select.js"></script>
<script type="text/javascript">
    new PCAS('province', 'city', 'area', '<?php echo ($activity['province']?$activity['province']:'广东省'); ?>', '<?php echo ($activity['city']?$activity['city']:'广州市'); ?>', '<?php echo ($activity['area']?$activity['area']:'天河区'); ?>');
</script>
<link rel="stylesheet" href="/Public/Home/layer_mobile/need/layer.css"/>
<script type="text/javascript" src="/Public/Home/layer_mobile/layer.js"></script>


<script>
	$("#sumbitBtn").click(function () {
        var school = $("input[name='school']").val();
        if (school == '')
        {
            message('请填写学校后提交！');
            return false;
        }
      //  href="<?php echo U('Answer/answer_true#router2');?>"
		var formdata = $("#answer_form").serialize();
        $.ajax({
            type: "POST",
            url: "<?php echo U('adduser_answer_true');?>",//+tab,
            data: formdata,// 你的formid 搜索表单 序列化提交
            dataType: 'json',
            success: function (data) {
                if (data.status == 1) {
                    message(data.message);
                    setTimeout(function () {
                        window.location.href=data.url;
                    },2000);
					//$("#user_hotel_from").trigger('reset');
                } else {
                    message(data.message);
                    return false;
                }
            }
        });
    })

    //提示
    function message(msg) {
        layer.open({
            content: msg,
            skin: 'msg',
            time: 2 //2秒后自动关闭
        });
    }
</script>

<!--
<script>
	//var total_num = <?php echo ($answer_count); ?>;
	var true_num = 0;
	var false_num = 0;

    $(document).ready(function () {
        $("#answer_1").show();
    });

    //提交答案
    function AnswerBtn(id_num,exactness){
       // Zepto.toast('回答错误', 2345, 'success top');
		var id_str = "#answer_result_"+id_num;//结果容器
		var choose = $(".active .answer_"+id_num).val();//选中答案
		if (choose == undefined)
		{
            message('请选择答案后提交');
            return false;
		}
		if(choose == exactness)
		{
		    //答对
            $("#exactness_"+id_num).hide();
			var html = "<p  style='margin-top:-20px;'>你的回答：<font class='green'>"+choose+' '+"正确</font></p>"
			$(id_str).prepend(html);
            true_num++;
		}else
		{
		    //答错
            var html = "<p  style='margin-top:-20px;'>你的回答：<font class='red'>"+choose+' '+"错误</font></p>"
            $(id_str).prepend(html);
            false_num++;
		}

		//报告
		if(false_num == 0)
		{
            var accuracy=100;
        }
		else
		{
		    var total = (true_num + false_num);
		    if(true_num !=0)
		    	var accuracy = ((true_num/total).toFixed(2)*100);
		    else
		        var accuracy = 0;
		}
		var total = (true_num+false_num);
        $("#total_num").text(total);
        $("#accuracy").text(accuracy);
        $("#true_num").text(true_num);
        $("#false_num").text(false_num);
		//alert(true_num)



		//禁用
        $(".jq_radio label").unbind();
		$("#sumbit_"+id_num).css('display','none');
       	$(id_str).show();
    }


    //下一题
	function next_answer(next_id) {
        //绑回选择事件
        $(".jq_radio label").bind('click',
			function(){
                $(".jq_radio dd").removeClass("active");
                $(this).parent().addClass("active");
		});
        //隐藏上一题
        $(".div"+next_id).css('display','none');
        //显示下一题
        var now_id = ++next_id;
        $("#now_id").html(now_id);
        $("#answer_"+now_id).show();

    }

    //提示
    function message(msg) {
        layer.open({
            content: msg,
            skin: 'msg',
            time: 2 //2秒后自动关闭
        });
    }
</script>-->